<form name="form" class="form-horizontal" novalidate ng-submit="form.$valid && vm.save()">
    <div class="modal-header">
        <h4 class="modal-title">配置集群</h4>
    </div>
    <div class="modal-body">
        <div class="form-group" ng-class="{'has-error':(form.code.$touched || form.$submitted ) &&
        (form.code.$error.required || form.code.$error.pattern)}">
            <label for="code" class="col-sm-3 control-label">集群编码</label>
            <div class="col-sm-7">
                <input type="text" maxlength="50" id="code" name="code" ng-model="vm.formdata.code" class="form-control" placeholder="请输入编码"
                       ng-pattern="/^\w+$/" required/>
                <div class="text-danger" ng-show="(form.code.$touched || form.$submitted ) &&
                (form.code.$error.required || form.code.$error.pattern)">
                    请输入有效编码 ( 允许数字、英文字母与下划线 )</div>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error': (form.name.$touched || form.$submitted )
        && form.name.$error.required}">
            <label for="name" class="col-sm-3 control-label">集群名称</label>
            <div class="col-sm-7">
                <input type="text" maxlength="50" id="name" name="name" ng-model="vm.formdata.name" class="form-control"
                       placeholder="请输入集群名称" required/>
                <div class="text-danger" ng-show="(form.name.$touched || form.$submitted )
                 && form.name.$error.required">请输入集群名称</div>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':(form.addr.$touched || form.$submitted ) &&
        (form.addr.$error.required || form.addr.$error.pattern)}">
            <label for="addr" class="col-sm-3 control-label">DashBoard 地址</label>
            <div class="col-sm-7">
                <input type="text" id="addr" name="addr" ng-model="vm.formdata.addr" class="form-control"
                       placeholder="请输入DashBoard 地址, 如10.10.10.10:80"
                       ng-pattern="/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\:[0-9]{1,5}$/" required/>
                <div class="text-danger" ng-show="(form.addr.$touched || form.$submitted ) &&
                    (form.addr.$error.required || form.addr.$error.pattern)">
                    请输入有效的DashBoard 地址 ( 如10.10.10.10:80 )
                </div>
            </div>
        </div>

         <div class="form-group" ng-class="{'has-error':(form.distributedWebUrl.$touched || form.$submitted ) &&
        (form.distributedWebUrl.$error.required || form.distributedWebUrl.$error.pattern)}">
            <label for="distributedWebUrl" class="col-sm-3 control-label">分布式web地址</label>
            <div class="col-sm-7">
                <input type="text" id="distributedWebUrl" name="distributedWebUrl" ng-model="vm.formdata.distributedWebUrl" class="form-control"
                       placeholder="请输入分布式web地址, 如10.10.10.10:80"
                       ng-pattern="/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\:[0-9]{1,5}$/" required/>
                <div class="text-danger" ng-show="(form.distributedWebUrl.$touched || form.$submitted ) &&
                    (form.distributedWebUrl.$error.required || form.distributedWebUrl.$error.pattern)">
                    请输入有效的分布式web地址 ( 如10.10.10.10:80 )
                </div>
            </div>
        </div>

        <div class="form-group margin-bottom-0" ng-class="{'has-error':(form.tengineClusterCode.$touched || form.$submitted ) &&
        (form.tengineClusterCode.$error.required || form.tengineClusterCode.$error.pattern)}">
            <label for="tengineClusterCode" class="col-sm-3 control-label">Tengine集群编码</label>
            <div class="col-sm-7">
                <input type="text" id="tengineClusterCode" name="tengineClusterCode" ng-model="vm.formdata.tengineClusterCode" class="form-control"
                       placeholder="请输入Tengine集群编码"
                       ng-pattern="/^\w+$/" required/>
                <div class="text-danger" ng-show="(form.tengineClusterCode.$touched || form.$submitted ) &&
                    (form.tengineClusterCode.$error.required || form.tengineClusterCode.$error.pattern)">
                    请输入有效的Tengine集群编码( 允许数字、英文字母与下划线 )
                </div>
            </div>
        </div>
        <!--<div class="form-group margin-bottom-0" ng-class="{'has-error':(form.lvs.$touched || form.$submitted ) &&
        (form.lvs.$error.required || form.lvs.$error.pattern)}">
            <label for="lvs" class="col-sm-3 control-label">LVS 地址</label>
            <div class="col-sm-7">
                <input type="text" id="lvs" name="lvs" ng-model="vm.lvs" class="form-control"
                       placeholder="请输入LVS 地址, 如10.10.10.11"
                       ng-pattern="/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/" required/>
                <div class="text-danger" ng-show="(form.lvs.$touched || form.$submitted ) &&
                    (form.lvs.$error.required || form.lvs.$error.pattern)">
                    请输入有效的LVS 地址 ( 如10.10.10.11 )
                </div>
            </div>
        </div>-->
    </div>
    <div class="modal-footer">
        <button type="submit" ng-disabled="vm.loading" class="btn btn-primary btn-sm">
            <i ng-show="vm.loading" class="fa fa-cog fa-lg fa-spin margin-right-5"/>确定
        </button>
        <button ng-click="vm.cancel()" type="button" class="btn btn-default btn-sm">取消</button>
    </div>
</form>